import mockRequest from '@/utils/mockRequest'
/**
 * @description 获取交易信息
 * @return promise
 */
export const reqTradeInfo = () => {
  return mockRequest('/api/order/auth/trade')
}
/**
 * @description 获取用户收货地址
 * @returns promise
 */
export const requserAddress = () => {
  return mockRequest('/api/user/userAddress/auth/findUserAddressList')
}
/**
 * @description 提交订单
 * @param {*} data https://www.showdoc.com.cn/2077491945864902/9443888348945332
 * @returns promise
 */
export const reqSubmitOrder = (data) => {
  return mockRequest.post(`/api/order/auth/submitOrder?tradeNo=${data.tradeNo}`, data)
}
/**
 * @description 获取订单支付信息
 * @param {*} orderId 订单ID
 * @returns promise
 */
export const reqPayment = (orderId) => {
  return mockRequest.get(`/api/payment/weixin/createNative/${orderId}`)
}
/**
 * @description 查询订单的支付状态
 * @param {*} orderId 订单ID
 * @returns promise
 */
export const reqPayStatus = (orderId) => {
  return mockRequest.get(`/api/payment/weixin/queryPayStatus/${orderId}`)
}
/**
 * @description 获取订单列表(我的订单界面)
 * @param {*} page 页码
 * @param {*} limit 每页显示数量
 * @returns promise
 */
export const reqOrderList = (page, limit) => {
  return mockRequest(`/api/order/auth/${page}/${limit}`)
}
